home *** CD-ROM | disk | FTP | other *** search
- Path: sargas.omicron.se!elias
- From: elias@omicron.se (Elias Martenson)
- Newsgroups: comp.lang.c
- Subject: C uses simple LALR parsing?
- Date: 14 Mar 1996 16:48:58 GMT
- Organization: Omicron
- Message-ID: <4i9ilq$92a@sargas.omicron.se>
- NNTP-Posting-Host: graffias.omicron.se
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
- X-Newsreader: NN version 6.5.0 #2 (NOV)
-
- This question has been subject to major debate among me and my firends:
-
- Does the C standard specify what kind of parser to use? If it uses
- (and is does seem that at least AT&T C and GCC does) a simple
- LALR parser it would mean that the following expression:
-
- a+++++b
-
- Yields:
-
- SYMBOL INCR INCR ADD SYMBOL
-
- Instead of the desired result (which is acieved when doing a++ + ++b):
-
- SYMBOL INCR ADD INCR SYNBOL
-
- Is it legal for a C compiler to parse the expression like the last
- example?
-
- Regards /
- Elias
-
- --
- Elias Martenson ! When I come up with a good joke,
- elias@omicron.se ! it will be here.
-